package com.webchat.aigc.repository.dao;

import com.webchat.aigc.repository.entity.BotEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface IBotDAO extends JpaSpecificationExecutor<BotEntity>, JpaRepository<BotEntity, Long> {


    BotEntity findAllByCode(String code);

    @Query(value = "select bot.code from BotEntity bot where bot.status = :status")
    List<String> findAllBotCodeAndStatus(Integer status);
}